<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<link rel="stylesheet" type="text/css" href="../js/style.css" />
<script language="javascript" src="../js/PopupCalendar.js" ></script>
<title>湖北包装网会员管理系统</title></head>
<body>

<script >

var oCalendarEn=new PopupCalendar("oCalendarEn");	//初始化控件时,请给出实例名称如:oCalendarEn
oCalendarEn.Init();


var oCalendarChs=new PopupCalendar("oCalendarChs");	//初始化控件时,请给出实例名称:oCalendarChs
oCalendarChs.weekDaySting=new Array("日","一","二","三","四","五","六");
oCalendarChs.monthSting=new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
oCalendarChs.oBtnTodayTitle="今天";
oCalendarChs.oBtnCancelTitle="取消";
oCalendarChs.startYear=1990;
oCalendarChs.endYear=2019;
oCalendarChs.Init();
</script>
<script type="text/javascript">
function searchChange(s){
	if(s==0){
		window.location.href="../user/searchAllUser.action";
	}else if(s==1){
		window.location.href="../user/searchPerUser.action";
	}else if(s==2){
		window.location.href="../user/searchComUser.action";
	}else{
	
	}
}


function submit(){
		var user_name = document.getElementById("user_name").value;
		var user_mail = document.getElementById("user_mail").value;
		var user_joindatestart = document.getElementById("user_joindatestart").value;
		var user_joindateend = document.getElementById("user_joindateend").value;
		window.location.href="../user/searchAllUser.action?user_name="+user_name+"&user_mail="+user_mail+"&user_joindatestart="+user_joindatestart+"&user_joindateend="+user_joindateend;
}
</script>
<script type="text/javascript">
function del_confirm(id)
  {
  
   if(confirm("是否删除?"))
    {
       window.location.href="../user/webUserDel.action?user_id="+id;
    }

  }
</script>
<jsp:include page="adminTitle.jsp" flush="true"></jsp:include>
<div id="mainpage">
  <div class="bodytitle">
    <div class="bodytitleleft"></div>
    <div class="bodytitletxt">会员管理 </div>
    <!-- <div class="bodytitletxt2"><a href="../user/getAllComUser.action">企业会员</a></div>
    <div class="bodytitletxt2"><a href="../user/getAllPerUser.action">个人会员</a></div>
    <div class="bodytitletxt2"><a href="../user/getAllWebUser.action">网站会员</a></div> -->
  </div>
  <div>
  
  	<table align="center" id="webusertable" >
  		<tr>
  			<td style="font-size: 12px">用户名：<input type="text" id="user_name"/> </td>
  			<td style="font-size: 12px">邮箱：<input type="text" id="user_mail"/></td>
  			<td style="font-size: 12px">注册时间：
  			<input readonly type="text" name="user_joindatestart"  onclick="getDateString(this,oCalendarChs)"/> -
  			<input readonly type="text" name="user_joindateend"  onclick="getDateString(this,oCalendarChs)"/>
  			</td>
  		</tr>
  	</table>
  	<table align="center">
  		<tr>
  			<td>
  				<select id="usertype" onchange="searchChange(this.options[this.options.selectedIndex].value)">
  					<option value="0">全部会员</option>
  					<option value="1">个人会员</option>
  					<option value="2">企业会员</option> 
  				</select>
  			</td>
  			<td><input type="button" value="查询" onclick="submit()"/> </td>
  		</tr>
  	</table>
  </div>
  <table cellpadding="0" cellspacing="0" border="0" id="table" class="sortable">
		<thead>
			<tr>
				<th class="nosort"><h3>用户名</h3></th>
				<th class="nosort"><h3>邮箱</h3></th>
				<th><h3>注册时间</h3></th>
				<th><h3>用户等级</h3></th>
				<th class="nosort"><h3>详细信息</h3></th>
				<th class="nosort"><h3>编辑</h3></th>
				<th class="nosort"><h3>删除</h3></th>
			</tr>
		</thead>
		<tbody>
		<s:iterator value="webUserList">
			<tr>
				<td><a href="#"><font size="2px"><s:property value="user_name"/></font></a></td>
				<td><font size="2px"><s:property value="user_mail"/></font></td>
				<td><font size="2px"><s:property value="user_joindate"/></font></td>
				<td><font size="2px"><s:if test="user_level==0">网站会员</s:if><s:elseif test="user_level==1">个人会员</s:elseif><s:elseif test="user_level==2">企业会员</s:elseif><s:elseif test="user_level==3">审核通过,未确认汇款</s:elseif><s:else>网站会员（审核未通过）</s:else></font> </td>
				<td>
					<s:if test="user_level==0"><img src="img/ico-edit.gif" onclick='location.href="../user/webUserView.action?user_id=<s:property value="user_id"/>"' style="cursor: hand"/></s:if>
					<s:if test="user_level==1"><img src="img/ico-edit.gif" onclick='location.href="../user/perUserView.action?user_id=<s:property value="user_id"/>"' style="cursor: hand"/></s:if>
					<s:if test="user_level==2"><img src="img/ico-edit.gif" onclick='location.href="../user/comUserView.action?user_id=<s:property value="user_id"/>"' style="cursor: hand"/></s:if>
				</td>
				<td>
					<s:if test="user_level==0"><img src="img/ico-edit.gif" onclick='location.href="../user/webUserEditBack.action?user_id=<s:property value="user_id"/>"' style="cursor: hand"/></s:if>
					<s:if test="user_level==1"><img src="img/ico-edit.gif" onclick='location.href="../user/ToPerUserEdit.action?user_id=<s:property value="user_id"/>"' style="cursor: hand"/></s:if>
					<s:if test="user_level==2"><img src="img/ico-edit.gif" onclick='location.href="../user/ToEditCompanyUser.action?user_id=<s:property value="user_id"/>"' style="cursor: hand"/></s:if>
					
				</td>
				<td><img src="img/ico-del1.gif" onclick='del_confirm(<s:property value='user_id'/>)' style="cursor: hand"/></td>
			</tr>
		</s:iterator>
		</tbody>
  </table>
	<div id="controls">
		<div id="perpage">
			<select onchange="sorter.size(this.value)">
			    <option value="5">5</option>
				<option value="10" selected="selected">10</option>
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
			</select>
			<span><font size="2px">输入分页条数</font></span>
		</div>
		<div id="navigation">
			<img src="../js/images/first.gif" width="16" height="16" alt="First Page" onclick="sorter.move(-1,true)" />
			<img src="../js/images/previous.gif" width="16" height="16" alt="First Page" onclick="sorter.move(-1)" />
			<img src="../js/images/next.gif" width="16" height="16" alt="First Page" onclick="sorter.move(1)" />
			<img src="../js/images/last.gif" width="16" height="16" alt="Last Page" onclick="sorter.move(1,true)" />
		</div>
		<div id="text"><font size="2px">显示页面： <span id="currentpage"></span> of <span id="pagelimit"></span> </font></div>
	</div>
	<script type="text/javascript" src="../js/script.js"></script>
	<script type="text/javascript">
    var sorter = new TINY.table.sorter("sorter");
	sorter.head = "head";
	sorter.asc = "asc";
	sorter.desc = "desc";
	sorter.even = "evenrow";
	sorter.odd = "oddrow";
	sorter.evensel = "evenselected";
	sorter.oddsel = "oddselected";
	sorter.paginate = true;
	sorter.currentid = "currentpage";
	sorter.limitid = "pagelimit";
	sorter.init("table");<!-- sorter.init("table",0);参数表示选中第几列  -->
	sorter.size(10);
  </script>
</div>
</body>
</html>